function Vector(x, y) {
    this.x = x;
    this.y = y;
};


Vector.prototype.equal = function(v) {
  return this.x == v.getX() && this.y == v.getY();
};

Vector.prototype.getX = function() {
  return this.x;
};

Vector.prototype.getY = function() {
  return this.y;
};

Vector.prototype.setX = function(x) {
  this.x = x;
};

Vector.prototype.setY = function(y) {
  this.y = y;
};

Vector.prototype.addX = function(x) {
  this.x += x;
};

Vector.prototype.addY = function(y) {
  this.y += y;
};

Vector.prototype.set = function(v) {
  this.x = v.getX();
  this.y = v.getY();
};

Vector.prototype.add = function(v) {
  this.x += v.getX();
  this.y += v.getY();
};

Vector.prototype.sub = function(v) {
  this.x -= v.getX();
  this.y -= v.getY();
};

Vector.prototype.dotProd = function(v) {
  return this.x * v.getX() + this.y * v.getY();
};

Vector.prototype.dist = function(v) {
  return Math.sqrt((this.x - v.getX()) * (this.x - v.getX()) + (this.y - v.getY()) * (this.y - v.getY()));
};

Vector.prototype.length = function() {
  return Math.sqrt(this.x * this.x + this.y * this.y);
};

Vector.prototype.scale = function(scaleFactor) {
  this.x *= scaleFactor;
  this.y *= scaleFactor;
};

Vector.prototype.normalize = function() {
  var l = this.length();
  this.x /= l;
  this.y /= l;
};

Vector.prototype.toString = function() {
  return " X: " + this.x + " Y: " + this.y;
};
